#ifndef Image_H
#define Image_H
#include "Matrix.h"
#include <Windows.h>

#pragma pack(push,1)

class Image : public Matrix
{
public:
	Image() {}
	Image(int h, int w);
	Image(int h, int w, unsigned char val); 
	Image(const char* ImageName); 
	Image(unsigned char m[][100], int n); 
	Image(unsigned char** m, int h, int w);
	Image(const Matrix& m); 
	Image(const Image& im); 
	virtual ~Image(); 

	void ReadBMP(const char* ImageName);
	void WriteBMP(const char* filename); 
	void myFree(unsigned char** data, int h);
	void Flip(int code); 
	void Resize(int h, int w);
	void Resize(int h, int w, int);
	void Cut(int x1, int y1, int x2, int y2);
	void Rotate(int degree);
	double Mean();
	double Variance();

	void myImageFree(double** data, int h);
	void showImage();

	BITMAPFILEHEADER bmpfileheader;
	BITMAPINFOHEADER bitmapinfoheader;
};
#endif

